package com.titan.core.utils.dbinfo.bean;

/**
 * @author 周成功
 * @email 86898837@qq.com
 * @date 2020年02月14日
 */
public class ColumnBean {
    private String tablename;  // 对应表英文名 nameZh
    private String nameEn;
    private String nameZh;
    private String comments;
    private int datalength;
    private int dataprecision;
    private int datascale;
    private String sqltype;
    private String nullable;   // 是否可以为空 Y:可以为空 N:不能为空
    public ColumnBean() {
    }


    public String toString() {
        StringBuffer info =new StringBuffer();
        info.append("name_en="+nameEn+",");
        info.append("name_zh="+nameZh+",");
        info.append("sqltype="+sqltype+",");
        info.append("datalength="+datalength+",");
        info.append("dataprecision="+dataprecision+",");
        info.append("datascale="+datascale+",");
        info.append("comments="+comments+",");
        info.append("tablename="+tablename+",");
        info.append("nullable="+nullable+"\n");
        return info.toString();
    }

    
    public String getTablename() {
        return tablename;
    }


    
    public void setTablename(String tablename) {
        this.tablename = tablename;
    }


    
    public String getNameEn() {
        return nameEn;
    }


    
    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }


    
    public String getNameZh() {
        return nameZh;
    }


    
    public void setNameZh(String nameZh) {
        this.nameZh = nameZh;
    }


    
    public String getComments() {
        return comments;
    }


    
    public void setComments(String comments) {
        this.comments = comments;
    }


    
    public int getDatalength() {
        return datalength;
    }


    
    public void setDatalength(int datalength) {
        this.datalength = datalength;
    }


    
    public int getDataprecision() {
        return dataprecision;
    }


    
    public void setDataprecision(int dataprecision) {
        this.dataprecision = dataprecision;
    }


    
    public int getDatascale() {
        return datascale;
    }


    
    public void setDatascale(int datascale) {
        this.datascale = datascale;
    }


    
    public String getSqltype() {
        return sqltype;
    }

//    public String getJavatype() {
//        if(sqltype.equalsIgnoreCase("VARCHAR2")||sqltype.equalsIgnoreCase("VARCHAR")||sqltype.equalsIgnoreCase("CHAR")) {
//            return "String";
//        } 
//        if(sqltype.equalsIgnoreCase("NUMBER")) {
//            if(datascale != 0) {
//                return "Double";
//            } else {
//                return "Integer";
//            }
//        }
//        if(sqltype.equalsIgnoreCase("DATE")) {
//            return "java.util.Date";
//        }
//        return "String";
//    }
    
    public void setSqltype(String sqltype) {
        this.sqltype = sqltype;
    }


    public String getNullable() {
        return nullable;
    }


    
    public void setNullable(String nullable) {
        this.nullable = nullable;
    }


}
